﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HierarchicalClustering.Metrics
{
    public class MetricFactory   // creates distance metrics
    {
        public static IMetric GetMetric(string name, int numOfDocuments)
        {   // get distance metric by name
            if (name == "Euclidean distance")
                return new Euclidean(numOfDocuments);
            else if (name == "Cosine similarity")
                return new Cosine(numOfDocuments);
            return null;
        }

        public static IEnumerable<string> GetMetricNames()
        {   // get distance metric names
            yield return "Euclidean distance";
            yield return "Cosine similarity";
            yield break;
        }
    }
}
